﻿CREATE TABLE [dbo].[SeriiNumericeRezervare] (
    [IdSNRezervare] INT              IDENTITY (1, 1) NOT NULL,
    [CodUnitate]    SMALLINT         NOT NULL,
    [IdSerie]       NVARCHAR (20)    NOT NULL,
    [Data]          DATETIME         CONSTRAINT [DF_SeriiNumericeRezervare_Data] DEFAULT (getdate()) NOT NULL,
    [UserID]        UNIQUEIDENTIFIER NOT NULL,
    CONSTRAINT [PK_SeriiNumericeRezervare] PRIMARY KEY CLUSTERED ([IdSNRezervare] ASC, [CodUnitate] ASC),
    CONSTRAINT [FK_SeriiNumericeRezervare_SeriiNumerice] FOREIGN KEY ([IdSerie], [CodUnitate]) REFERENCES [dbo].[SeriiNumerice] ([IdSerie], [CodUnitate]),
    CONSTRAINT [FK_SeriiNumericeRezervare_Unitati] FOREIGN KEY ([CodUnitate]) REFERENCES [dbo].[Unitati] ([CodUnitate])
);

